<?php
require_once(dirname(dirname(dirname(__FILE__))).'/helper.php');
global $definition, $source_all_abbrs;
?>
<li serial="<?=$definition['serial']?>">
	<em class="definition"><?=$definition['definition']?></em>
	<br />
	<ul class="piece-little">
	<?php $comefroms = explode(',', $definition['comefrom']); foreach($comefroms as $comefrom) { ?>
		<?php if($comefrom == $comefroms[0]) { ?>
		<li serial="<?=$comefrom?>"><a class="button source-single" href="<?=get_source_url($comefrom)?>"><?=$source_all_abbrs[$comefrom]?></a></li>
		<?php } else {?>
		<li serial="<?=$comefrom?>"><a class="button source" href="<?=get_source_url($comefrom)?>"><?=$source_all_abbrs[$comefrom]?></a><a class="button split" title="Split" onclick="dictionary.split(this)">&times;</a></li>
		<?php }?>
	<?php } ?>
	</ul>
	<div class="clear"></div>
	<?php if($definition['conflict_definition']) foreach($definition['conflict_definition'] as $conflict) { ?>
		<?php if($conflict == "") { ?> 
		<p class="conflict"><span>(Dropped from <?=$conflict['comefrom']?>) - </span>
		<?php } else { ?>
		<p class="conflict"><span>(Changed from <?=$conflict['comefrom']?>) - </span><?=$conflict['definition']?>
		<?php }?>
		<a href="#" class="cancel" title="Discard" onclick="dictionary.handle_conflict(this, <?=$conflict['serial']?>, 'discard')">Discard</a>
		<a href="#" class="ok" title="Adopt" onclick="dictionary.handle_conflict(this, <?=$conflict['serial']?>, 'adopt')">Adopt</a></p>
	<?php } ?>
</li>
